from django.db import models


# Create your models here.
class User(models.Model):
    GENDER_CHOICES = (
        (0, '男'),
        (1, '女')
    )

    class Meta:
        verbose_name_plural = '用户表'

    account = models.CharField(max_length=16, unique=True, verbose_name='账号')
    password = models.CharField(max_length=16, verbose_name='密码')
    username = models.CharField(max_length=64, verbose_name='用户名', blank=True)
    money = models.DecimalField(max_digits=12, decimal_places=2, default=0, verbose_name='余额', blank=True)
    gender = models.PositiveSmallIntegerField(default=0, verbose_name='性别', blank=True,
                                              choices=GENDER_CHOICES)  # 0:男 1:女
    tel = models.CharField(max_length=32, default='', verbose_name='电话', blank=True)

    def __str__(self):
        return self.account
